package com.foodndate.food.member;


import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class MemberDao {
@Autowired private SqlSession sql;

	public void insert(MemberDto memberbean) {
	
		sql.insert("member.insert",memberbean);
		
	}	
	
	public int chk(String id) {
		/*System.out.println("dao : " + memberDto.getMember_id());*/
		
		return sql.selectOne("member.chk", id);
	}

	public int login(MemberDto memberdto) {
		System.out.println("dao : 로그인 아이디 : "+memberdto.getMember_id());
		System.out.println("dao : 로그인 패스워드 : "+memberdto.getMember_pw());
		
		return sql.selectOne("member.login", memberdto);
	}

	public MemberDto info(MemberDto memberdto) {
		System.out.println("dao : 디테일 정보 :"+ memberdto.getMember_id());
		
		return sql.selectOne("member.detail", memberdto); 
		
	}

	public int updateprocess(MemberDto memberdto) {
		System.out.println("dao: 디테일 수정정보" +memberdto.getMember_id());
		return sql.update("member.update", memberdto);
		
	}
	public int delete(MemberDto memberdto){
		System.out.println("dao: 삭제정보"+memberdto.getMember_id());
		
		return sql.delete("member.delete", memberdto);
	}

	public List list(MemberDto memberdto) {
		System.out.println("dao리스트");
		return sql.selectList("member.list", memberdto);
	}

	public int admin(int num) {
		
		return sql.delete("member.admindel", num);
	}
	
	
	
}
